<?php

// +----------------------------------------------------------------------
// | Apprh.Shop
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2027 http://www.apprh.com All rights reserved.
// +----------------------------------------------------------------------
// | Notice: This code is not open source, it is strictly prohibited
// |         to distribute the copy, otherwise it will pursue its
// |         legal responsibility.
// +----------------------------------------------------------------------
// | Author: 雲溪荏苒 <290648237@qq.com>
// +----------------------------------------------------------------------

namespace app\frontend\controller;

use controller\HomeBase;


/**
 * 网站案例控制器
 *
 * Class Sitecase
 * @package app\frontend\controller
 * @author 雲溪荏苒 <290648237@qq.com>
 * @date 2017/11/19
 */
class Sitecase extends HomeBase
{

    /**
     * 网站案例
     * @return mixed
     */
    public function index()
    {
        $this->assign('generator', request()->domain().'/,cn,109,,5,M1156010');
        $this->assign('body_class', 'class-109');

        // 获取网站行业列表
        $siteIndustryList = M('site_industry')->where('status', 1)->order('sort asc')->select();
        $this->assign('siteIndustryList', $siteIndustryList);

        $caseList = model('site_case')->getSiteCaseByCate(6, 9);
        $this->assign('caseList', $caseList);
//        dump($caseList);die;


        // SEO
        $this->assign('seo_title', '网站设计推荐案例,网站建设推荐案例,网站制作推荐案例 - '.sysconf('seo_title'));
        $this->assign('seo_keywords', '网站设计推荐案例,网站建设推荐案例,网站制作推荐案例,立鼎科技精品推荐案例,'.sysconf('seo_keywords'));
        $this->assign('seo_description', '知名网站建设公司立鼎科技的网站案例，凭借优质的服务品质，超前的设计理念为众多企业提供优质的官方网站，做网站请选立鼎科技，了解更多精品推荐案例请致电'.sysconf('hc_phone').'。'.sysconf('seo_description'));

        return $this->fetch('');
    }

    public function lists()
    {
        $industry_id = I('industry_id', 0);
        $this->assign('cur_industry_id', $industry_id);

        $this->assign('generator', request()->domain().'/,cn,'.$industry_id.',,5,M1156010');
        $this->assign('body_class', 'class-'.$industry_id);

        // 获取网站行业列表
        $siteIndustryList = M('site_industry')->where('status', 1)->order('sort asc')->select();
        $this->assign('siteIndustryList', $siteIndustryList);

        list($caseList, $caseTotal) = model('site_case')->getSiteCaseList(['status' => 1, 'industry_id' => $industry_id], 0, 50);
        $this->assign('caseList', $caseList);
//        dump($caseList);die;


        // SEO
        $this->assign('seo_title', '网站设计推荐案例,网站建设推荐案例,网站制作推荐案例 - '.sysconf('seo_title'));
        $this->assign('seo_keywords', '网站设计推荐案例,网站建设推荐案例,网站制作推荐案例,立鼎科技精品推荐案例,'.sysconf('seo_keywords'));
        $this->assign('seo_description', '知名网站建设公司立鼎科技的网站案例，凭借优质的服务品质，超前的设计理念为众多企业提供优质的官方网站，做网站请选立鼎科技，了解更多精品推荐案例请致电'.sysconf('hc_phone').'。'.sysconf('seo_description'));

        return $this->fetch('');
    }

    public function show()
    {
        $info = db('site_case')->findOrFail(I('case_id'));
        $this->assign('info', $info);
        $this->assign('cur_cid', $info['industry_id']);

        $this->assign('generator', request()->domain().'/,cn,'.$info['industry_id'].',,5,M1156010');
        $this->assign('body_class', 'class-'.$info['industry_id']);

        // 推荐案例
        list($recCaseList, $pTotal) = model('site_case')->getSiteCaseList(['status' => 1, 'is_recommend' => 1], 0, 6, 'view desc');
        $this->assign('recCaseList', $recCaseList);

        // 访问量+1
        model('site_case')->setViewInc(I('case_id'));

        $this->assign('seo_title', '网站设计推荐案例,网站建设推荐案例,网站制作推荐案例 - '.sysconf('seo_title'));
        $this->assign('seo_keywords', '网站设计推荐案例,网站建设推荐案例,网站制作推荐案例,立鼎科技精品推荐案例,'.sysconf('seo_keywords'));
        $this->assign('seo_description', '知名网站建设公司立鼎科技的网站案例，凭借优质的服务品质，超前的设计理念为众多企业提供优质的官方网站，做网站请选立鼎科技，了解更多精品推荐案例请致电'.sysconf('hc_phone').'。'.sysconf('seo_description'));

        return $this->fetch('');
    }
}
